<template>
  <view class="my-search-container" :style="{ 'background-color' : bgcolor }">
    <view class="my-search-box" :style="{ 'border-radius': radius+ 'px'}" @click="searchHandler">
    <uni-icons type="search" size="17"></uni-icons>
    <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"search",
    props: {
      bgcolor: {
        type: String,
        default: '#fff'
      },
      radius: {
        type : Number,
        default: 25
      }
    },
    data() {
      return {
        
      };
    },
    methods: {
      searchHandler() {
        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
  
.my-search-container {
// background-color: #fff;
height: 50px;
// margin-bottom: 16px;
display: flex;
align-items: center;
}
.my-search-box {
height: 40px; 
background-color: #fff;
box-shadow: 0px 0px 10px #eee;
// border-radius: 25px;
width: 94%;
display: flex;
transform: translate(3%);
align-items: center;
justify-content: center;
.placeholder {
font-size: 15px;
margin-left: 5px;
}
}
</style>